<!DOCTYPE html>
<html>
<head>
    <title>工厂印刷机配置表</title>
		<#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/ziyun-erp.css">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline" role="form">
                <div class="form-group">
                    <a @click="reset">
                        <i class="fa fa-refresh"></i>
                    </a>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.printFactoryName" @keyup.enter="query"
                           placeholder="工厂印刷机名称">
                </div>&nbsp;&nbsp;&nbsp;
            <#if shiro.hasPermission("quotePrintFactory:quoteprintfactory:list")>
            <a class="btn btn-primary btn-sm" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
            </#if>
			<#if shiro.hasPermission("quotePrintFactory:quoteprintfactory:save")>
            <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<!--<#if shiro.hasPermission("quotePrintFactory:quoteprintfactory:update")>
            <a class="btn btn-primary btn-sm" @click="update" hidden><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>-->
			<#if shiro.hasPermission("quotePrintFactory:quoteprintfactory:delete")>
            <a class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </form>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" style="width: auto;">
            <hr class="form-horizontal" style="width: auto;">
                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">机器名称</div>
                            <div class="col-sm-6">
                                <input type="hidden"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.factoryId"/>
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.printFactoryName" placeholder="机器名称"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">类型</div>
                            <div class="col-sm-6">
                            <select class="input-sm col-sm-12 " v-model="quotePrintFactoryVo.quotePrintFactory.printName" placeholder="类型">
                                <option v-for="item in e.quotePrintPrintTypeEnum" :value="item.value">{{item.describe}}</option>
                            </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label"> 印刷最大尺寸长(/mm)：</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.maxLength" placeholder="机器最大尺寸长"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label"> 印刷最大尺寸宽(/mm)</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.maxWide" placeholder="机器最大尺寸宽"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">印刷最小尺寸长(/mm)</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.minLength" placeholder="机器最小尺寸长"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">印刷最小尺寸宽(/mm)</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.minWide" placeholder="机器最小尺寸宽"/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">涨价尺寸长(/mm)</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.riseLenght" placeholder="涨价尺寸长"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">涨价尺寸宽(/mm)</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.riseWide" placeholder="涨价尺寸宽"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">最小克重</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.minWeight" placeholder="最小克重"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">最大克重</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.maxWeight" placeholder="最大克重"/>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">大数量值</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.largeQuantity"  placeholder="大数量值"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <div class="col-sm-6 control-label">出血尺寸</div>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.deficit" placeholder=" 出血尺寸"/>
                            </div>
                        </div>
                    </div>
                 <div class="col-md-3">
                    <div class="form-group">
                        <div class="col-sm-6 control-label">起始数量</div>
                        <div class="col-sm-6">
                            <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.startAmount" placeholder="起始数量"/>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group">
                        <div class="col-sm-6 control-label">增幅数量</div>
                        <div class="col-sm-6">
                            <input type="text"  class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.stepAmount" placeholder="增幅数量"/>
                        </div>
                    </div>
                </div>
                </div>
            <div class="form-group">
            <el-form :model="quotePrintFactoryVo.quotePrintFacotoryPirceList"   label-width="130px" size="small">
                <el-form-item label="机器价格设置"  prop="machinePrice" >
                    <template>
                        <el-table border :data="quotePrintFactoryVo.quotePrintFacotoryPirceList" style="width: 100%" >
                            <el-table-column  font-color="black" prop="breadthLength" label="颜色">
                                <template scope="scope">
                                    <select class="input-sm col-sm-12 " v-model="scope.row.colour" placeholder="请选择">
                                        <option v-for="item in e.quotePrintFactoryPriceColourEnum" :value="item.value">{{item.describe}}</option>
                                    </select>
                                </template>
                            </el-table-column>
                            <el-table-column  font-color="black" prop="begin_price" label="开机费">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.beginPrice" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="step_price" label="印次/千">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.stepPrice" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="large_price" label="免开机印次/千">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.largePrice" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="rise_begin_price" label="涨价开机费">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.riseBeginPrice" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="rise_step_price" label="印次/千(涨价)">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.riseStepPrice" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="rise_large" label="涨价免开机印次/千">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.riseLarge" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="print_plate_price" label="版费(ctp)">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.printPlatePrice" controls-position="right"  :min="0" ></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="floating_coefficient" label="利润系数">
                                <template scope="scope">
                                    <el-input-number v-model="scope.row.floatingCoefficient" controls-position="right"  :min="0"></el-input-number>
                                </template>
                            </el-table-column>
                            <el-table-column  font-color="black" prop="display" label="是否启用">
                                <template scope="scope">
                                    <el-switch
                                            v-model="scope.row.display"
                                            active-color="#13ce66"
                                            inactive-color="#ff4949"
                                    >
                                    </el-switch>
                                </template>
                            </el-table-column>
                         <el-table-column fixed="right"  label="操作">
                                <template slot-scope="scope">
                                    <el-button type="primary" @click="addRow(quotePrintFactoryVo.quotePrintFacotoryPirceList)">新增</el-button>
                                    <el-button @click.native.prevent="deleteRow(scope.$index, quotePrintFactoryVo.quotePrintFacotoryPirceList)" size="small"> 移除 </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                </el-form-item>
            </el-form>
            </div>

            <div class="row">
                <div class="col-md-3">
                    <div class="form-group">
                        <div class="col-sm-6 control-label">特种纸价格设置:</div>
                        <div class="col-sm-6">
                            <el-switch
                                    v-model="quotePrintFactoryVo.quotePrintFactory.canUv"
                                    active-text="是"
                                    inactive-text="否"
                                    @change="changeUv">
                            </el-switch>
                        </div>
                    </div>
                </div>

                <div class="col-md-3" v-if="quotePrintFactoryVo.quotePrintFactory.canUv">
                    <div class="form-group">
                        <div class="col-sm-6 control-label">是否按价格系数配置特种纸变价:</div>
                        <div class="col-sm-6">
                            <el-switch
                                    v-model="followUv"
                                    active-text="是"
                                    inactive-text="否"
                                    @change="changeFollowUv"
                            >
                            </el-switch>
                        </div>
                    </div>
                </div>
                <div class="col-md-3" v-if="followUv&&quotePrintFactoryVo.quotePrintFactory.canUv">
                    <div class="form-group">
                        <div class="col-sm-6 control-label">特种纸变价系数</div>
                        <div class="col-sm-6">
                            <input type="text"  @change="changeRatio" class="form-control" v-model="quotePrintFactoryVo.quotePrintFactory.ratio" placeholder="特种纸变价系数"/>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group">
                        <div class="col-sm-12" style="color: red">
                            <strong>(注：两种价格方式只能二选一，只能以一种价格计算)</strong>
                        </div>
                    </div>
                </div>
            </div>

            <div v-show="quotePrintFactoryVo.quotePrintFactory.canUv">
            <!--特种纸价格设置-->
            <div class="form-group" v-show="!followUv">
                <el-form    label-width="130px" size="small">
                    <el-form-item label="特种纸价格设置"  prop="machinePrice" >
                            <el-table border :data="uVQuotePrintFacotoryPirceList" style="width: 100%" >
                                <el-table-column   prop="colour" label="颜色" >
                                    <template scope="scope">
                                        <select class="input-sm col-sm-12 " v-model="scope.row.colour" placeholder="请选择">
                                            <option v-for="item in e.quotePrintFactoryPriceColourEnum" :value="item.value">{{item.describe}}</option>
                                        </select>
                                    </template>
                                </el-table-column>
                                <el-table-column  font-color="black" prop="begin_price" label="开机费">
                                    <template scope="scope">
                                        <el-input-number  v-model="scope.row.beginPrice" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="step_price" label="印次/千">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.stepPrice" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="large_price" label="免开机印次/千">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.largePrice" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="rise_begin_price" label="涨价开机费">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.riseBeginPrice" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="rise_step_price" label="印次/千(涨价)">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.riseStepPrice" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="rise_large" label="涨价免开机印次/千">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.riseLarge" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="print_plate_price" label="版费(ctp)">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.printPlatePrice" controls-position="right"  :min="0" ></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  prop="floating_coefficient" label="利润系数">
                                    <template scope="scope">
                                        <el-input-number v-model="scope.row.floatingCoefficient" controls-position="right"  :min="0"></el-input-number>
                                    </template>
                                </el-table-column>
                                <el-table-column  font-color="black" prop="display" label="是否启用">
                                    <template scope="scope">
                                        <el-switch
                                                v-model="scope.row.display"
                                                active-color="#13ce66"
                                                inactive-color="#ff4949"
                                        >
                                        </el-switch>
                                    </template>
                                </el-table-column>
                               <!-- <el-table-column fixed="right"  label="操作">
                                    <template slot-scope="scope">
                                        <el-button type="primary" @click="addUvRow(uVQuotePrintFacotoryPirceList)">新增</el-button>
                                        <el-button @click.native.prevent="deleteRow(scope.$index, uVQuotePrintFacotoryPirceList)" size="small"> 移除 </el-button>
                                    </template>
                                </el-table-column>-->
                            </el-table>
                    </el-form-item>
                </el-form>
            </div>

            <!--以变价价格设置-->
            <div class="form-group" v-show="followUv">
                <el-form    label-width="130px" size="small">
                    <el-form-item label="特种纸价格设置"  prop="machinePrice" >
                        <el-table border :data="uVQuotePrintFacotoryPirceList" style="width: 100%" >
                            <el-table-column   prop="colour" label="颜色" :formatter="colorFormat">
                            </el-table-column>
                            <el-table-column  font-color="black" prop="beginPrice" label="开机费">
                            </el-table-column>
                            <el-table-column  prop="stepPrice" label="印次/千">
                            </el-table-column>
                            <el-table-column  prop="largePrice" label="免开机印次/千">
                            </el-table-column>
                            <el-table-column  prop="riseBeginPrice" label="涨价开机费">
                            </el-table-column>
                            <el-table-column  prop="riseStepPrice" label="印次/千(涨价)">
                            </el-table-column>
                            <el-table-column  prop="riseLarge" label="涨价免开机印次/千">
                            </el-table-column>
                            <el-table-column  prop="printPlatePrice" label="版费(ctp)">
                            </el-table-column>
                            <el-table-column  prop="floatingCoefficient" label="利润系数">
                            </el-table-column>
                            <el-table-column  font-color="black" prop="display" label="是否启用">
                                <template scope="scope">
                                    <el-switch
                                            v-model="scope.row.display"
                                            active-color="#13ce66"
                                            inactive-color="#ff4949"
                                    >
                                    </el-switch>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-form-item>
                </el-form>
            </div>
            </div>

                <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary  btn-sm" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
            </div>
       </form>
    </div>
</div>
<#include "/modules/quotePrintFactory/quoteprintfactoryEdit.html">
<script src="${request.contextPath}/statics/js/modules/quotePrintFactory/quoteprintfactory.js?_${.now?long}"></script>
</body>
</html>